<?php
class MHDEV_View_Helper_GetAvatarSource extends Zend_View_Helper_Abstract
{
	public function GetAvatarSource($uid)
	{
		$baseUrl 	= new MHDEV_View_Helper_BaseUrl();
		$typ 		= array('gif','jpeg','jpg','png');
		
		$avatar		= FALSE;
		
		foreach($typ AS $filetyp)
		{
			$source = 'upload/avatar/' . intval($uid) . '.' . $filetyp;
			
			if(is_file($source))
			{
				$avatar = $source;
			}
		}
		
		return $avatar;
	}
}
?>